package cloud.zhixinglu.www.spring.boot.email.controller;

import cloud.zhixinglu.www.spring.boot.email.biz.MailBiz;
import cloud.zhixinglu.www.spring.boot.email.enums.MailContentTypeEnum;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * EmailController
 * </p>
 *
 * @author weixin
 * @date 2023/8/3 15:04
 */
@RestController
public class EmailController {

    @Resource
    private MailBiz mailBiz;

    @GetMapping("sendMail")
    public void sendMail() {
        mailBiz.contentType(MailContentTypeEnum.HTML)
                .title("测试")
                .to("zhangjing@linkunknown.com")
                .content("<h1>测试content</h1>")
                .send();
    }

}
